/*
 * EndScreenController
 */

package demo;

import java.awt.Graphics;
import java.util.logging.Level;
import java.util.logging.Logger;
import javaPlay.GameEngine;
import javaPlay.GameState;
import javaPlay.Keyboard;
import javaPlay.Sprite;

/**
 * @author VisionLab/PUC-Rio
 */
public class EndScreenController implements GameState {
	
	private Sprite endScreen;
	
	public void load() {
		try {
			endScreen = new Sprite("finalback.jpg", 1, 800, 600);
		} catch (Exception ex) {
			Logger.getLogger(EndScreenController.class.getName()).log(Level.SEVERE, null, ex);
		}
	}
	
	public void unload() {
		
	}
	
	public void start() {
		
	}
	
	public void step(long gameTime, long timeElapsed) {
		Keyboard k = GameEngine.getInstance().getKeyboard();
		
		if (k.isKeyDown(Keyboard.ENTER_KEY) == true) {
			GameEngine.getInstance().changeGameState(Global.START_MENU_CONTROLLER_ID);
		}
	}
	
	public void draw(Graphics g) {
		endScreen.draw(g, 0, 0);
	}
	
	public void stop() {
		
	}
}
